package com.tarena.lbs.basic.service.impl;

import com.tarena.lbs.basic.dao.mapper.AreaMapper;
import com.tarena.lbs.basic.pojo.vo.AreaVO;
import com.tarena.lbs.basic.service.AreaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class AreaServiceImpl implements AreaService {
	
	@Autowired
	private AreaMapper areaMapper;
	
	@Override
	public List<AreaVO> queryProvinces() {
		log.debug(">>>查询省级地区列表业务");
		return areaMapper.queryProvinces();
	}
	
	@Override
	public List<AreaVO> queryCities(Long parentId) {
		log.debug(">>>查询地市列表业务：parentId：{}", parentId);
		return areaMapper.queryCities(parentId);
	}
	
	@Override
	public List<AreaVO> queryCityTree() {
		log.debug(">>>查询地市树列表业务");
		return areaMapper.queryCityTree();
	}
	
}
